<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * CEP_Brazil filter form base class.
 *
 * @package    filters
 * @subpackage CEP_Brazil *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseCEP_BrazilFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'bai_no'              => new sfWidgetFormFilterInput(),
      'cep'                 => new sfWidgetFormFilterInput(),
      'log_tipo_logradouro' => new sfWidgetFormFilterInput(),
      'log_no_sem_acento'   => new sfWidgetFormFilterInput(),
      'loc_nosub'           => new sfWidgetFormFilterInput(),
      'ufe_no'              => new sfWidgetFormFilterInput(),
      'ufe_sg'              => new sfWidgetFormFilterInput(),
      'log_complemento'     => new sfWidgetFormFilterInput(),
      'log_no'              => new sfWidgetFormFilterInput(),
      'log_nome'            => new sfWidgetFormFilterInput(),
      'bai_no_abrev'        => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'bai_no'              => new sfValidatorPass(array('required' => false)),
      'cep'                 => new sfValidatorPass(array('required' => false)),
      'log_tipo_logradouro' => new sfValidatorPass(array('required' => false)),
      'log_no_sem_acento'   => new sfValidatorPass(array('required' => false)),
      'loc_nosub'           => new sfValidatorPass(array('required' => false)),
      'ufe_no'              => new sfValidatorPass(array('required' => false)),
      'ufe_sg'              => new sfValidatorPass(array('required' => false)),
      'log_complemento'     => new sfValidatorPass(array('required' => false)),
      'log_no'              => new sfValidatorPass(array('required' => false)),
      'log_nome'            => new sfValidatorPass(array('required' => false)),
      'bai_no_abrev'        => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cep_brazil_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CEP_Brazil';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'bai_no'              => 'Text',
      'cep'                 => 'Text',
      'log_tipo_logradouro' => 'Text',
      'log_no_sem_acento'   => 'Text',
      'loc_nosub'           => 'Text',
      'ufe_no'              => 'Text',
      'ufe_sg'              => 'Text',
      'log_complemento'     => 'Text',
      'log_no'              => 'Text',
      'log_nome'            => 'Text',
      'bai_no_abrev'        => 'Text',
    );
  }
}